package org.iabako.client.ui.page.business.product;

import org.iabako.client.config.page.PageConfigEnum;
import org.iabako.client.navigation.NavigationController;
import org.iabako.client.tools.IabakoAsyncCallback;
import org.iabako.client.ui.form.business.product.ProductForm;
import org.iabako.shared.entity.business.AbstractEntity;
import org.iabako.shared.entity.business.Product;

/**
 * Created by jose on 16/01/15.
 */
public class ProductModify extends ProductForm {

    public ProductModify() {
        super(PageConfigEnum.ProductModify, "");

        String[] params = NavigationController.getInstance().getParams();

        productServiceAsync.getById(Long.parseLong(params[0]), new IabakoAsyncCallback<AbstractEntity>() {
            public void onSuccess(AbstractEntity result) {

                setProduct((Product) result);

                super.onSuccess(result);
            }
        });
    }
}
